﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Panel : PanelControl
{
    PanelBusiness pb = new PanelBusiness();
    protected void Page_Load(object sender, EventArgs e)
    {
        
        PanelEntities item = pb.getPanel(_id);
        if (item != null)
        {
            if (item._displayContrainer.Equals("True"))
            {
                this.ptitle.Visible = true;
                this.ptitle.InnerHtml = "<p>"+item._pannelHeader+"</p>";
            }
            PanelControl objp = (PanelControl)LoadControl(item._controlSourceFile);
            objp._id = item._panelID;
            objp._field1 = item._field1;
            objp._field2 = item._field2;
            this.pcontent.Controls.Add(objp);
        }
    }
}